import React, {Component} from 'react';
import Tabs from '@/components/Tabs/Tabs';
import TabPane from '@/components/Tabs/TabPane';

export default class TabView extends Component {

  constructor() {
    super();
    this.state = {
      activeIndex: 2,
    }
  }

  render() {
    const { activeIndex } = this.state;
    return (
      <Tabs
        prefixClass="tabs"
        activeIndex={activeIndex}
        defaultIndex={activeIndex}
        onChange={(index) => this.setState({
          activeIndex: index,
        })}
      >
        <TabPane
          index={1}
          tab="Tab 1"
        >
          Tab 1
        </TabPane>
        <TabPane
          index={2}
          tab="Tab 2"
        >
          Tab 2
        </TabPane>
      </Tabs>
    )
  }
}
